package com.zy.dp.bridge.example3;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class JDBCTest
{
	@SuppressWarnings("unused")
	public static void main(String[] args) throws Exception
	{
		String sql = "具体要操作的sql语句";

		Class.forName("驱动的名字");

		Connection conn = DriverManager.getConnection("连接数据库服务的URL", "用户名",
				"密码");

		PreparedStatement pstmt = conn.prepareStatement(sql);

		ResultSet rs = pstmt.executeQuery(sql);

		while (rs.next())
		{

			String uuid = rs.getString("uuid");

			int age = rs.getInt(2);
		}

		rs.close();
		pstmt.close();
		conn.close();
	}
}
